import config from 'config'
import httpFetch from 'share/httpFetch'

export default {

  getUsersCredit(params){
    return httpFetch.get(`${config.baseUrl}/api/credit/users`, params)
  },

  getCreditEvents(params){
    return httpFetch.get(`${config.baseUrl}/api/credit/user/history`, params)
  },

  saveCreditEvents(params){
    return httpFetch.post(`${config.baseUrl}/api/credit/history`, params)
  },

  disableRecord(id, cancelReason){
    return httpFetch.post(`${config.baseUrl}/api/credit/${id}/disable?cancelReason=${cancelReason}`)
  }

}
